package com.gxa.web_admin.controller.operationscontroller;

import com.gxa.common.R;
import com.gxa.modules.service.operationsservice.LtyZuHuRenYuanService;
import com.gxa.modules.service.operationsservice.PnZuHuXinXiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Company
 * @Classname LtyZuHuRenYuanController
 * @Description TODO
 * @Author lty
 * Date 2022/5/10 0010 9:49
 * Version 1.0
 */

@Api(value = "租户管理-租户人员管理-lty", tags = "租户管理-租户人员管理API")
@RestController
@RequestMapping("/ZuHuRenYuanGuanLi")
public class LtyZuHuRenYuanController {

    @Autowired(required = false)
    LtyZuHuRenYuanService ltyZuHuRenYuanService;

    @Autowired
    PnZuHuXinXiService pnZuHuXinXiService;


    @RequestMapping(value = "/selectLouYuXiaLa",method = RequestMethod.GET)
    @ApiOperation(value = "租户人员管理楼宇下拉列表-lty", notes = "租户人员管理楼宇下拉列表-lty",
            httpMethod = "GET", response = Map.class)
/*    @ApiImplicitParam(name = "username", value = "用户姓名", required = true,
            dataType = "String", paramType = "query")*/
    public R selectLouYuXiaLa(){
        return ltyZuHuRenYuanService.selectLouYuXiaLa();
    }


    @RequestMapping(value = "/selectRenYuanLeiXinXiaLa",method = RequestMethod.GET)
    @ApiOperation(value = "租户人员管理人员类型下拉列表-lty", notes = "租户人员管理人员类型下拉列表-lty",
            httpMethod = "GET", response = Map.class)
    public R selectRenYuanLeiXinXiaLa(){
        return ltyZuHuRenYuanService.selectRenYuanLeiXinXiaLa();
    }



    @RequestMapping(value = "/selectAllZuHuRenYuan",method = RequestMethod.GET)
    @ApiOperation(value = "租户人员管理首页全查-lty", notes = "租户人员管理首页全查-lty",
            httpMethod = "GET", response = Map.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页面码",required = true,paramType = "query",dataType = "int"),
            @ApiImplicitParam(name = "size",value = "显示条数",required = true,paramType = "query",dataType = "int"),
    })
    public R selectAllZuHuRenYuan(@RequestParam int page,@RequestParam int size){
        return ltyZuHuRenYuanService.selectAllZuHuRenYuan(page,size);
    }





    @RequestMapping(value = "/selectZuHuRenYuan",method = RequestMethod.GET)
    @ApiOperation(value = "租户人员管理首页条件查询-lty", notes = "租户人员管理首页条件查询-lty",
            httpMethod = "GET", response = Map.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页面码",required = true,paramType = "query",dataType = "int"),
            @ApiImplicitParam(name = "size",value = "显示条数",required = true,paramType = "query",dataType = "int"),
            @ApiImplicitParam(name = "zuHuMingCheng",value = "租户名称",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "louYu",value = "所属楼宇",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "fangJian",value = "房间名称",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "renYuan",value = "人员名称",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "lianXiFangShi",value = "联系方式",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "renYuanLeiXing",value = "人员类型",paramType = "query",dataType = "String")
    })
    public R selectZuHuRenYuan(@RequestParam int page,@RequestParam int size,
                               String zuHuMingCheng, String louYu , String fangJian ,
                               String renYuan , String lianXiFangShi, String renYuanLeiXing){
        return ltyZuHuRenYuanService.selectZuHuRenYuan(page,size,
                zuHuMingCheng,louYu,fangJian,renYuan,lianXiFangShi,renYuanLeiXing);
    }

    @PostMapping("/delZuHuRenYuan")
    @ApiOperation(value = "删除数据接口（单条 1；多条 1,2)-lty", notes = "删除数据", httpMethod = "POST", response = Map.class)
    @ApiImplicitParam(name = "ids",value = "删除数据的id/s",paramType = "query",dataType = "String")
    public R delZuHuRenYuan(String ids){
        return pnZuHuXinXiService.deleteByIds(ids);
    }






}
